#include<iostream>
#include<vector>
using namespace std;

vector<int>path;
vector<vector<int> >result;

vector<vector<int> >backtracking(vector<int>&nums,int startindex){
	result.push_back(path);
    for(int i=startindex;i<nums.size();i++){
    	path.push_back(nums[i]);
    	backtracking(nums,i+1);
    	path.pop_back();
	}	
	return result;
}

int main()
{
	int num[15]={0};
	vector<int>nums={1,2,3};
	vector<vector<int> >result=backtracking(nums,0);
	cout<<' '<<endl;
	for(vector<vector<int> >::iterator it=result.begin();it!=result.end();it++){
		for(vector<int>::iterator iit=(*it).begin();iit!=(*it).end();iit++){
			cout<<*iit<<' ';
		}
		cout<<endl;
	}
	return 0;
 } 
